#ifndef LINEAR_SEARCH_H
#define LINEAR_SEARCH_H

#include <iostream>

using namespace std;

int linearSearch(int arr[], int n, int x) {
    for (int i = 0; i < n; i++) {
        if (arr[i] == x)
            return i;
    }
    return -1;
}

#endif